module.exports = {
    apps: [ {
        name: 'hotel',
        instances: 0,
        wait_ready: true,
        exec_mode: 'cluster',
        script: 'app/app.js',
        max_memory_restart: '680M',
        log_date_format: 'YYYY-MM-DD HH:mm:ss',
        merge_logs: true,
        env: {
            NODE_ENV: 'production',
            ENABLE_NODE_LOG: 'YES',
            NODE_LOG_DIR: '/tmp'
        }
    }, {
        name: 'hotel-jobs',
        instances: 1,
        exec_mode: 'cluster',
        script: 'jobs/index.js',
        max_memory_restart: '500M',
        log_date_format: 'YYYY-MM-DD HH:mm:ss',
        merge_logs: true,
        env: {
            NODE_ENV: 'production',
            ENABLE_NODE_LOG: 'YES',
            NODE_LOG_DIR: '/tmp'
        }
    }, {
        name: 'hotel-ping',
        instances: 1,
        script: 'ping/index.js',
        max_memory_restart: '100M',
        log_date_format: 'YYYY-MM-DD HH:mm:ss',
        merge_logs: true,
    }],
    deploy: {
        dev: {
            user: 'root',
            host: ['hlg8'],
            ref: 'origin/dev',
            repo: 'git@gitee.com:sharkseven/hotel.git',
            path: '/data/web/hotel',
            'post-deploy': 'npm i --production --no-save && npm run migrate && npm run docs && npm start'
        },
        release: {
            user: 'root',
            host: ['localhost'],
            ref: 'origin/release',
            repo: 'git@gitee.com:sharkseven/hotel.git',
            path: '/data/web/hotel',
            'post-deploy': 'npm i --production --no-save && npm run migrate && npm start'
        },
        production: {
            user: 'root',
            host: ['localhost'],
            ref: 'origin/master',
            repo: 'git@gitee.com:sharkseven/hotel.git',
            path: '/data/web/hotel',
            'post-deploy': 'npm i --production --no-save && npm run migrate && npm start'
        }
    }
};
